/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 涛
 * Date: 2023-09-11
 * Time: 21:41
 */


public class Test {

    public static void main(String[] args) {
        Dog dog = new Dog("花花",10);
        dog.eat();
        dog.bark();
    }


    public static void main1(String[] args) {
        Base base = new Base();
        Derived derived = new Derived();

//        System.out.println(derived.a);
//        System.out.println(derived.b);
//        System.out.println(derived.c);
//        System.out.println("======================");
        derived.test();

    }
}
class Animal {
    public String name;
    public int age;

    public void eat() {
        System.out.println(this.name+"正在吃饭");
    }

    public Animal(String name,int age) {
        this.name = name;
        this.age = age;
    }
    public Animal() {

    }
}
class Dog extends Animal {
    public Dog(String name,int age) {
        //System.out.println("asdadfasads");
        super(name,age);
        System.out.println("Dog");
        //super();
    }
    public void bark() {
        System.out.println(this.name+"汪汪叫");
    }

    public void test() {

    }
}

class Base {
    int a = 1;
    int b = 2;
    int d = 9;
    public void test1() {
        System.out.println("Base");
    }
}
class Derived extends Base {
    int c = 3;
    int d = 199;
    public void test1() {
        System.out.println("Derived");
    }
    public void test() {
//        super.test1();
        System.out.println(d);
        System.out.println(this.d);
        System.out.println(super.d);
    }
}